#ifndef JEU_H
#define JEU_H

#include <QWidget>
#include <QTimer>
#include <QDebug>
#include <QVector>

#include "plateau.h"
#include "menu.h"
#include "vague.h"
#include "usine.h"
#include "case.h"
#include "ennemi.h"
#include "defense.h"

class Ennemi;
class Defense;

class Jeu : public QWidget
{
    Q_OBJECT
private:
    Usine<Ennemi> ennemis;
    Usine<Defense> defenses;
    QVector<Vague> vagues;
    QVector<QVector<Case*> > map;
    int nbVies;
    int nbCredits;
    bool vagueLancee;
    int vague;
    int ennemiVague;
    int nbennemiVague;
    int compteurVague;
    QPoint depart;
    Plateau plateau;
    Menu menu;
    QTimer timer;
    QGraphicsItem* emplacementDefense;
    QPoint creerDefense;
public:
    const QPoint& getCreerDefense() const { return creerDefense; }
    QVector<QVector<Case*> >& getMap() { return map; }
    void charger_map(QString);
    const QPoint& getDepart() const { return depart; }
    Usine<Ennemi>& getEnnemis() { return ennemis; }
    Plateau& getPlateau() { return plateau; }
    explicit Jeu(QWidget *parent = 0);
    QTimer& getTimer() { return timer; }

    void charger_vagues();

signals:

public slots:
    void eau();
    void pierre();
    void peinture();
    void petanque();
    void musique();
    void mouse(QPointF);
    void avancer();
    void lancerVague();
    void startpause();
    void perdreVie();

};

#endif // JEU_H
